<style lang="less" scoped>
    .addproduct {
        width: 100%;
        height: auto;
        overflow: hidden;
        text-align: left;
        padding: 8px;
        //display: flex;
        .example-split {
            display: block;
            position: absolute;
            top: 0;
            bottom: 0;
            border: 1px dashed #eee;
            @media (max-width: 992px) {
                border: none;
            }
        }
    }
</style>
<template>
    <div class="addproduct">
        <my-card cardtitle="添加工艺：" :showright="false">
            <template>
                <Steps :current="current" status="wait">
                    <Step :title="getcurrenttitle(0)" content="添加产品基本信息"></Step>
                    <Step :title="getcurrenttitle(1)" content="配置工艺步骤"></Step>
                    <Step :title="getcurrenttitle(2)" content="添加工艺参数"></Step>
                    <Step :title="getcurrenttitle(3)" content="添加BOM信息"></Step>
                </Steps>
                <div v-if="current == 0" style="padding: 30px 10px">
                    <Form :model="basicform" :label-width="120" :ref="ref" :rules="rule">
                        <FormItem label="产品编号：" prop="nub">
                            <base-input v-model="basicform.nub" placeholder="请输入产品编号" width="400px"></base-input>
                        </FormItem>
                        <FormItem label="客户产品编号：" prop="cnub">
                            <base-input v-model="basicform.cnub" placeholder="请输入客户产品编号" width="400px"></base-input>
                        </FormItem>
                        <FormItem label="产品名称：" prop="name">
                            <base-input v-model="basicform.name" placeholder="请输入产品名称" width="400px"></base-input>
                        </FormItem>
                        <FormItem label="产品规格：" prop="norm">
                            <base-input v-model="basicform.norm" placeholder="请输入产品规格" width="400px"></base-input>
                        </FormItem>
                        <FormItem label="产品颜色：" prop="color">
                            <base-input v-model="basicform.color" placeholder="请输入产品颜色" width="400px"></base-input>
                        </FormItem>
                        <FormItem label="产品类型：" prop="type">
                            <base-input v-model="basicform.type" placeholder="请输入产品类型" width="400px"></base-input>
                        </FormItem>
                        <FormItem label="产品单位：" prop="unit">
                            <base-input v-model="basicform.unit" placeholder="请输入单位" width="400px"></base-input>
                        </FormItem>
                        <FormItem label="机种：" prop="machine">
                            <Input v-model="basicform.machine" type="textarea" placeholder="请输入机种信息,多个机种使用|隔开" :maxlength="80" style="width: 400px"></Input>
                        </FormItem>
                        <FormItem label="图号：" prop="version">
                            <base-input v-model="basicform.version" placeholder="请输入图号" width="400px"></base-input>
                        </FormItem>
                    </Form>
                </div>
                <div v-if="current == 1" style="padding: 30px 10px">
                    <Form ref="bzform" :model="bzform" :label-width="80" style="width: 600px">
                        <FormItem
                            v-for="(item, index) in bzform.items"
                            :key="index"
                            :label="'工序 ' + (index + 1) + ':'"
                            :prop="'items.' + index + '.value'"
                            :rules="{required: true, message: 'Item ' + item.index +' can not be empty', trigger: 'blur'}">
                            <Row>
                                <Col span="14">
                                    <Select v-model="item.value">
                                        <Option v-for="gy in gylist" :value="gy.value" :key="gy.value" :disabled="item.disabled">{{ gy.label }}</Option>
                                    </Select>
                                </Col>
                                <Col span="4" offset="1">
                                    <Button type="ghost" @click="handleAdd(index)" style="width: 100%">添加</Button>
                                </Col>
                                <Col span="4">
                                    <Button type="ghost" @click="handleRemove(index)" style="width: 100%;margin-left: 10px">删除</Button>
                                </Col>
                            </Row>
                        </FormItem>
                    </Form>
                </div>
                <div v-if="current == 2" style="padding: 30px 10px">
                    <Card>
                        <Steps :current="gycurrent" status="wait" size="small">
                            <Step :title="getgycurrenttitle(index)" v-for="(item, index) in bzform.items" :key="index" :content="item.value | gycontent"></Step>
                        </Steps>
                        <div v-if="bzform.items[gycurrent].value == 'zz'" style="padding: 30px 10px">
                            <Row>
                                <Col :xs="24" :md="12" :sm="24">
                                    <header class="example-header">
                                        <span style="margin-left: 20px">
                                            工艺参数
                                        </span>
                                    </header>
                                    <Form ref="qdform" :model="qdform" :label-width="120">
                                        <FormItem label="盘头根数：" prop="qd_ptgs">
                                            <base-input v-model="qdform.qd_ptgs" placeholder="请输入盘头根数" width="80%"></base-input>
                                        </FormItem>
                                        <FormItem label="生产条数：" prop="qd_scts">
                                            <base-input v-model="qdform.qd_scts" placeholder="请输入生产条数" width="80%"></base-input>
                                        </FormItem>
                                        <FormItem label="排列方式：" prop="qd_plfs">
                                            <base-input v-model="qdform.qd_plfs" placeholder="请输入排列方式" width="80%"></base-input>
                                        </FormItem>
                                        <FormItem label="扣数：" prop="qd_qs">
                                            <base-input v-model="qdform.qd_ks" placeholder="请输入扣数" width="80%"></base-input>
                                        </FormItem>
                                        <FormItem label="纬密：" prop="qd_wm">
                                            <base-input v-model="qdform.qd_wm" placeholder="请输入纬密" width="80%"></base-input>
                                        </FormItem>
                                        <FormItem label="织带速度：" prop="qd_zdsd">
                                            <base-input v-model="qdform.qd_zdsd" placeholder="请输入织带速度" width="80%"></base-input>
                                        </FormItem>
                                        <FormItem label="纱线规格：" prop="qd_sxgg">
                                            <base-input v-model="qdform.qd_sxgg" placeholder="请输入纱线规格" width="80%"></base-input>
                                        </FormItem>
                                        <FormItem label="纬线规格：" prop="qd_wxgg">
                                            <base-input v-model="qdform.qd_wxgg" placeholder="请输入纬线规格" width="80%"></base-input>
                                        </FormItem>
                                        <FormItem label="尺寸：" prop="qd_cc">
                                            <base-input v-model="qdform.qd_cc" placeholder="请输入尺寸" width="80%"></base-input>
                                        </FormItem>
                                        <FormItem label="毛高：" prop="qd_mg">
                                            <base-input v-model="qdform.qd_mg" placeholder="请输入毛高" width="80%"></base-input>
                                        </FormItem>
                                    </Form>
                                </Col>
                                <Col :xs="24" :md="12" :sm="24">
                                    <header class="example-header">
                                        <span style="margin-left: 20px">
                                            品质要求
                                        </span>
                                    </header>
                                <Form ref="qdform" :model="qdform" :label-width="120">
                                    <FormItem label="底板勾毛：" prop="qd_dbgm">
                                        <base-input v-model="qdform.qd_dbgm" placeholder="请输入底板勾毛" width="80%"></base-input>
                                    </FormItem>
                                    <FormItem label="毛平整度：" prop="qd_mpzd">
                                        <base-input v-model="qdform.qd_mpzd" placeholder="请输入毛平整度" width="80%"></base-input>
                                    </FormItem>
                                    <FormItem label="疵点：" prop="qd_cd">
                                        <base-input v-model="qdform.qd_cd" placeholder="请输入疵点" width="80%"></base-input>
                                    </FormItem>
                                </Form>
                                <header class="example-header">
                                        <span style="margin-left: 20px">
                                            图片上传
                                        </span>
                                </header>
                                <div style="text-align: left;padding: 20px">
                                   <!-- <Upload :action="qdaction" name="file" :show-upload-list="false" :on-success="onSuccess" :on-error="onError" :with-credentials="true">
                                        <Button type="ghost" icon="ios-cloud-upload-outline">点击上传</Button>
                                    </Upload>-->
                                    <uploadImg ref="zz" myref="zzupload" :action="qdaction"></uploadImg>
                                </div>
                                </Col>
                                <div class="example-split" style="left: 50%"></div>
                            </Row>
                        </div>
                        <div v-if="bzform.items[gycurrent].value == 'tj'">
                            <Row>
                                <Col :xs="24" :md="12" :sm="24">
                                    <header class="example-header">
                                            <span style="margin-left: 20px">
                                                工艺参数
                                            </span>
                                    </header>
                                    <div style="padding: 0px 20px">
                                        <header class="example-header">
                                            <span style="margin-left: 20px;font-size: 12px">
                                                温度
                                            </span>
                                        </header>
                                        <Form ref="tjform" :model="tjform" :label-width="120">
                                            <FormItem label="加热棒1：" prop="tj_jrb1">
                                                <base-input v-model="tjform.tj_jrb1" placeholder="请输入加热棒1温度" width="80%"></base-input>
                                            </FormItem>
                                            <FormItem label="加热棒2：" prop="tj_jrb2">
                                                <base-input v-model="tjform.tj_jrb2" placeholder="请输入加热棒2温度" width="80%"></base-input>
                                            </FormItem>
                                            <FormItem label="加热棒3：" prop="tj_jrb3">
                                                <base-input v-model="tjform.tj_jrb3" placeholder="请输入加热棒3温度" width="80%"></base-input>
                                            </FormItem>
                                            <FormItem label="加热棒4：" prop="tj_jrb4">
                                                <base-input v-model="tjform.tj_jrb4" placeholder="请输入加热棒4温度" width="80%"></base-input>
                                            </FormItem>
                                            <FormItem label="预烘箱1：" prop="tj_yhx1">
                                                <base-input v-model="tjform.tj_yhx1" placeholder="请输入预烘箱1温度" width="80%"></base-input>
                                            </FormItem>
                                            <FormItem label="预烘箱2：" prop="tj_yhx2">
                                                <base-input v-model="tjform.tj_yhx2" placeholder="请输入预烘箱2温度" width="80%"></base-input>
                                            </FormItem>
                                            <FormItem label="大烘箱：" prop="tj_wddhx">
                                                <base-input v-model="tjform.tj_wddhx" placeholder="请输入大烘箱温度" width="80%"></base-input>
                                            </FormItem>
                                        </Form>
                                    </div>
                                    <!--<div style="width: 100%;height: 1px;background-color: #eee"></div>-->
                                    <div style="margin: 0px 20px;">
                                        <header class="example-header">
                                            <span style="margin-left: 20px;font-size: 12px">
                                                一次上胶
                                            </span>
                                        </header>
                                        <Form ref="tjform" :model="tjform" :label-width="120">
                                            <FormItem label="胶辊刮刀：" prop="tj_jggd">
                                                <base-input v-model="tjform.tj_jggd" placeholder="请输入胶辊刮刀" width="80%"></base-input>
                                            </FormItem>
                                            <FormItem label="后刮刀：" prop="tj_hgd">
                                                <base-input v-model="tjform.tj_hgd" placeholder="请输入后刮刀" width="80%"></base-input>
                                            </FormItem>
                                        </Form>
                                        <div style="padding: 0px 40px">
                                            <header class="example-header">
                                            <span style="margin-left: 20px;font-size: 10px">
                                                电机频率
                                            </span>
                                            </header>
                                            <Form ref="tjform" :model="tjform" :label-width="120">
                                                <FormItem label="进带：" prop="tj_jd">
                                                    <base-input v-model="tjform.tj_jd" placeholder="请输入进带" width="80%"></base-input>
                                                </FormItem>
                                                <FormItem label="胶辊：" prop="tj_jg">
                                                    <base-input v-model="tjform.tj_jg" placeholder="请输入胶辊" width="80%"></base-input>
                                                </FormItem>
                                                <FormItem label="大烘箱：" prop="tj_dhx">
                                                    <base-input v-model="tjform.tj_dhx" placeholder="请输入大烘箱" width="80%"></base-input>
                                                </FormItem>
                                                <FormItem label="出带：" prop="tj_cd">
                                                    <base-input v-model="tjform.tj_cd" placeholder="请输入出带" width="80%"></base-input>
                                                </FormItem>
                                            </Form>
                                        </div>
                                    </div>
                                    <div style="margin: 0px 20px;">
                                        <header class="example-header">
                                                <span style="margin-left: 20px;font-size: 12px">
                                                    二次上胶
                                                </span>
                                        </header>
                                        <Form ref="tjform" :model="tjform" :label-width="120">
                                            <FormItem label="胶辊刮刀：" prop="tj_jggd2">
                                                <base-input v-model="tjform.tj_jggd2" placeholder="请输入胶辊刮刀" width="80%"></base-input>
                                            </FormItem>
                                            <FormItem label="后刮刀：" prop="tj_hgd2">
                                                <base-input v-model="tjform.tj_hgd2" placeholder="请输入后刮刀" width="80%"></base-input>
                                            </FormItem>
                                        </Form>
                                        <div style="padding: 0px 40px">
                                            <header class="example-header">
                                                <span style="margin-left: 20px;font-size: 10px">
                                                    电机频率
                                                </span>
                                            </header>
                                            <Form ref="tjform" :model="tjform" :label-width="120">
                                                <FormItem label="进带：" prop="tj_jd2">
                                                    <base-input v-model="tjform.tj_jd2" placeholder="请输入进带" width="80%"></base-input>
                                                </FormItem>
                                                <FormItem label="胶辊：" prop="tj_jg2">
                                                    <base-input v-model="tjform.tj_jg2" placeholder="请输入胶辊" width="80%"></base-input>
                                                </FormItem>
                                                <FormItem label="大烘箱：" prop="tj_dhx2">
                                                    <base-input v-model="tjform.tj_dhx2" placeholder="请输入大烘箱" width="80%"></base-input>
                                                </FormItem>
                                                <FormItem label="出带：" prop="tj_cd2">
                                                    <base-input v-model="tjform.tj_cd2" placeholder="请输入出带" width="80%"></base-input>
                                                </FormItem>
                                            </Form>
                                        </div>
                                    </div>
                                </Col>
                                <Col :xs="24" :md="12" :sm="24">
                                    <header class="example-header">
                                        <span style="margin-left: 20px">
                                            品质要求
                                        </span>
                                    </header>
                                    <Form ref="tjform" :model="tjform" :label-width="120">
                                        <FormItem label="尺寸：" prop="tj_chic">
                                            <base-input v-model="tjform.tj_chic" placeholder="请输入尺寸" width="80%"></base-input>
                                        </FormItem>
                                        <FormItem label="胶块情况：" prop="tj_jkqk">
                                            <base-input v-model="tjform.tj_jkqk" placeholder="请输入胶块情况" width="80%"></base-input>
                                        </FormItem>
                                        <FormItem label="烫情况：" prop="tj_tqk">
                                            <base-input v-model="tjform.tj_tqk" placeholder="请输入烫情况" width="80%"></base-input>
                                        </FormItem>
                                        <FormItem label="绒毛：" prop="tj_rm">
                                            <base-input v-model="tjform.tj_rm" placeholder="请输入绒毛" width="80%"></base-input>
                                        </FormItem>
                                    </Form>
                                    <header class="example-header">
                                            <span style="margin-left: 20px">
                                                图片上传
                                            </span>
                                    </header>
                                    <div style="text-align: left;padding: 20px">
                                        <uploadImg ref="tj" myref="tjupload" :action="tjaction"></uploadImg>
                                    </div>
                                </Col>
                                <div class="example-split" style="left: 50%"></div>
                            </Row>
                        </div>
                        <div v-if="bzform.items[gycurrent].value == 'ts'">
                            <Row>
                                <Col :xs="24" :md="12" :sm="24">
                                    <header class="example-header">
                                                <span style="margin-left: 20px">
                                                    工艺参数
                                                </span>
                                    </header>
                                    <Form ref="tsform" :model="tsform" :label-width="120">
                                        <FormItem label="模头前区温度：" prop="ts_mtqqwd">
                                            <base-input v-model="tsform.ts_mtqqwd" placeholder="请输入模头前区温度" width="80%"></base-input>
                                        </FormItem>
                                        <FormItem label="模头后区温度：" prop="ts_mthqwd">
                                            <base-input v-model="tsform.ts_mthqwd" placeholder="请输入模头后区温度" width="80%"></base-input>
                                        </FormItem>
                                        <FormItem label="烫带温度：" prop="ts_tdwd">
                                            <base-input v-model="tsform.ts_tdwd" placeholder="请输入烫带温度" width="80%"></base-input>
                                        </FormItem>
                                        <FormItem label="法兰圈温度：" prop="ts_flqwd">
                                            <base-input v-model="tsform.ts_flqwd" placeholder="请输入法兰圈温度" width="80%"></base-input>
                                        </FormItem>
                                        <FormItem label="接头加热温度：" prop="ts_jtjrwd">
                                            <base-input v-model="tsform.ts_jtjrwd" placeholder="请输入接头加热温度" width="80%"></base-input>
                                        </FormItem>
                                        <FormItem label="流道温度：" prop="ts_ldwd">
                                            <base-input v-model="tsform.ts_ldwd" placeholder="请输入流道温度" width="80%"></base-input>
                                        </FormItem>
                                        <FormItem label="进带牵引速度：" prop="ts_jdqysd">
                                            <base-input v-model="tsform.ts_jdqysd" placeholder="请输入进带牵引速度" width="80%"></base-input>
                                        </FormItem>
                                        <FormItem label="出带牵引速度：" prop="ts_cdqysd">
                                            <base-input v-model="tsform.ts_cdqysd" placeholder="请输入出带牵引速度" width="80%"></base-input>
                                        </FormItem>
                                        <FormItem label="水轮牵引速度：" prop="ts_slqysd">
                                            <base-input v-model="tsform.ts_slqysd" placeholder="请输入水轮牵引速度" width="80%"></base-input>
                                        </FormItem>
                                        <FormItem label="螺杆进给速度：" prop="ts_lgjjsd">
                                            <base-input v-model="tsform.ts_lgjjsd" placeholder="请输入螺杆进给速度" width="80%"></base-input>
                                        </FormItem>
                                        <FormItem label="主机转速：" prop="ts_zjzs">
                                            <base-input v-model="tsform.ts_zjzs" placeholder="请输入主机转速" width="80%"></base-input>
                                        </FormItem>
                                        <FormItem label="主机电流：" prop="ts_zjdl">
                                            <base-input v-model="tsform.ts_zjdl" placeholder="请输入主机电流" width="80%"></base-input>
                                        </FormItem>
                                        <FormItem label="机筒一区温度：" prop="ts_jtyqwd">
                                            <base-input v-model="tsform.ts_jtyqwd" placeholder="请输入机筒一区温度" width="80%"></base-input>
                                        </FormItem>
                                        <FormItem label="机筒二区温度：" prop="ts_jteqwd">
                                            <base-input v-model="tsform.ts_jteqwd" placeholder="请输入机筒二区温度" width="80%"></base-input>
                                        </FormItem>
                                        <FormItem label="机筒三区温度：" prop="ts_jtsqwd">
                                            <base-input v-model="tsform.ts_jtsqwd" placeholder="请输入机筒三区温度" width="80%"></base-input>
                                        </FormItem>
                                        <FormItem label="机筒四区温度：" prop="ts_jtfqwd">
                                            <base-input v-model="tsform.ts_jtfqwd" placeholder="请输入机筒四区温度" width="80%"></base-input>
                                        </FormItem>
                                        <FormItem label="机筒五区温度：" prop="ts_jtwqwd">
                                            <base-input v-model="tsform.ts_jtwqwd" placeholder="请输入机筒五区温度" width="80%"></base-input>
                                        </FormItem>
                                        <FormItem label="溶温：" prop="ts_rw">
                                            <base-input v-model="tsform.ts_rw" placeholder="请输入溶温" width="80%"></base-input>
                                        </FormItem>
                                    </Form>
                                </Col>
                                <Col :xs="24" :md="12" :sm="24">
                                    <header class="example-header">
                                                <span style="margin-left: 20px">
                                                    图片上传
                                                </span>
                                    </header>
                                    <div style="text-align: left;padding: 20px">
                                        <uploadImg ref="ts" myref="tsupload" :action="tsaction"></uploadImg>
                                    </div>
                                </Col>
                                <div class="example-split" style="left: 50%"></div>
                            </Row>
                        </div>
                        <div v-if="bzform.items[gycurrent].value == 'jj'">
                            <Row>
                                <Col :xs="24" :md="12" :sm="24">
                                <header class="example-header">
                                        <span style="margin-left: 20px">
                                            工艺参数
                                        </span>
                                </header>
                                <Form ref="jjform" :model="jjform" :label-width="120">
                                    <FormItem label="牵引速度：" prop="jj_qysd">
                                        <base-input v-model="jjform.jj_qysd" placeholder="请输入牵引速度" width="80%"></base-input>
                                    </FormItem>
                                    <FormItem label="牵引,分毛气压：" prop="jj_qyqy">
                                        <base-input v-model="jjform.jj_qyqy" placeholder="请输入牵引,分毛气压" width="80%"></base-input>
                                    </FormItem>
                                    <FormItem label="压轮气压：" prop="jj_ylqy">
                                        <base-input v-model="jjform.jj_ylqy" placeholder="请输入压轮气压" width="80%"></base-input>
                                    </FormItem>
                                </Form>
                                </Col>
                                <Col :xs="24" :md="12" :sm="24">
                                    <header class="example-header">
                                            <span style="margin-left: 20px">
                                                品质要求
                                            </span>
                                    </header>
                                    <Form ref="jjform" :model="jjform" :label-width="120">
                                        <FormItem label="打弯数：" prop="jj_dws">
                                            <base-input v-model="jjform.jj_dws" placeholder="请输入打弯数要求" width="80%"></base-input>
                                        </FormItem>
                                        <FormItem label="纺布：" prop="jj_fb">
                                            <base-input v-model="jjform.jj_fb" placeholder="请输入纺布" width="80%"></base-input>
                                        </FormItem>
                                    </Form>
                                    <header class="example-header">
                                                    <span style="margin-left: 20px">
                                                        图片上传
                                                    </span>
                                    </header>
                                    <div style="text-align: left;padding: 20px">
                                        <uploadImg ref="jj" myref="jjupload" :action="jjaction"></uploadImg>
                                    </div>
                                </Col>
                                <div class="example-split" style="left: 50%"></div>
                            </Row>
                        </div>
                        <div v-if="bzform.items[gycurrent].value == 'bj'">
                            <Row>
                                <Col :xs="24" :md="12" :sm="24">
                                <header class="example-header">
                                        <span style="margin-left: 20px">
                                            工艺参数
                                        </span>
                                </header>
                                <Form ref="bjform" :model="bjform" :label-width="120">
                                    <FormItem label="机台：" prop="bj_jt">
                                        <base-input v-model="bjform.bj_jt" placeholder="请输入机台" width="80%"></base-input>
                                    </FormItem>
                                    <FormItem label="铲梳电机转速：" prop="bj_csdjzs">
                                        <base-input v-model="bjform.bj_csdjzs" placeholder="请输入铲梳电机转速" width="80%"></base-input>
                                    </FormItem>
                                    <FormItem label="剃毛刀速度：" prop="bj_tmdsd">
                                        <base-input v-model="bjform.bj_tmdsd" placeholder="请输入剃毛刀速度" width="80%"></base-input>
                                    </FormItem>
                                </Form>
                                <div style="padding: 0px 20px">
                                    <header class="example-header">
                                            <span style="margin-left: 20px;font-size: 12px">
                                                气动喷涂底涂剂
                                            </span>
                                    </header>
                                    <Form ref="bjform" :model="bjform" :label-width="120">
                                        <FormItem label="气压：" prop="bj_qy">
                                            <base-input v-model="bjform.bj_qy" placeholder="请输入气动喷涂底涂剂气压" width="80%"></base-input>
                                        </FormItem>
                                        <FormItem label="持续时间：" prop="bj_cxsj">
                                            <base-input v-model="bjform.bj_cxsj" placeholder="请输入气动喷涂底涂剂持续时间" width="80%"></base-input>
                                        </FormItem>
                                        <FormItem label="间隔时间：" prop="bj_jgsj">
                                            <base-input v-model="bjform.bj_jgsj" placeholder="请输入气动喷涂底涂剂间隔时间" width="80%"></base-input>
                                        </FormItem>
                                    </Form>
                                    <header class="example-header">
                                        <span style="margin-left: 20px;font-size: 12px">
                                            飞毛
                                        </span>
                                    </header>
                                    <Form ref="bjform" :model="bjform" :label-width="120">
                                        <FormItem label="风量大小：" prop="bj_fldx">
                                            <base-input v-model="bjform.bj_fldx" placeholder="请输入飞毛风量大小" width="80%"></base-input>
                                        </FormItem>
                                        <FormItem label="牵引速度：" prop="bj_qysd">
                                            <base-input v-model="bjform.bj_qysd" placeholder="请输入飞毛牵引速度" width="80%"></base-input>
                                        </FormItem>
                                    </Form>
                                </div>
                                </Col>
                                <Col :xs="24" :md="12" :sm="24">
                                <header class="example-header">
                                    <span style="margin-left: 20px">
                                        品质要求
                                    </span>
                                </header>
                                <Form ref="bjform" :model="bjform" :label-width="120">
                                    <FormItem label="胶带与带子状态：" prop="bj_wz">
                                        <base-input v-model="bjform.bj_wz" placeholder="请输入胶带与带子状态要求" width="80%"></base-input>
                                    </FormItem>
                                    <FormItem label="剥离力：" prop="bj_bll">
                                        <base-input v-model="bjform.bj_bll" placeholder="请输入剥离力要求" width="80%"></base-input>
                                    </FormItem>
                                </Form>
                                <header class="example-header">
                                    <span style="margin-left: 20px">
                                        图片上传
                                    </span>
                                </header>
                                <div style="text-align: left;padding: 20px">
                                    <uploadImg ref="bj" myref="bjupload" :action="bjaction"></uploadImg>
                                </div>
                                </Col>
                                <div class="example-split" style="left: 50%"></div>
                            </Row>
                        </div>
                        <div v-if="bzform.items[gycurrent].value == 'fm'">
                            <Row>
                                <Col :xs="24" :md="12" :sm="24">
                                <header class="example-header">
                                        <span style="margin-left: 20px">
                                            工艺参数
                                        </span>
                                </header>
                                <Form ref="fmform" :model="fmform" :label-width="120">
                                    <FormItem label="机台：" prop="fm_jt">
                                        <base-input v-model="fmform.fm_jt" placeholder="请输入机台编号" width="80%"></base-input>
                                    </FormItem>
                                   <!-- <FormItem label="工装：" prop="fmgz">
                                        <base-input v-model="fmform.fmgz" placeholder="请输入工装" width="80%"></base-input>
                                    </FormItem>-->
                                    <FormItem label="滚刀频率：" prop="fm_gdpl">
                                        <base-input v-model="fmform.fm_gdpl" placeholder="请输入滚刀频率" width="80%"></base-input>
                                    </FormItem>
                                    <FormItem label="牵引频率：" prop="fm_qypl">
                                        <base-input v-model="fmform.fm_qypl" placeholder="请输入牵引频率" width="80%"></base-input>
                                    </FormItem>
                                    <FormItem label="条数：" prop="fm_ts">
                                        <base-input v-model="fmform.fm_ts" placeholder="请输入条数" width="80%"></base-input>
                                    </FormItem>
                                    <FormItem label="步骤：" prop="fm_bz">
                                        <base-input v-model="fmform.fm_bz" placeholder="请输入步骤" width="80%"></base-input>
                                    </FormItem>
                                    <FormItem label="铲梳电机转速：" prop="fm_csdjzs">
                                        <base-input v-model="fmform.fm_csdjzs" placeholder="请输入铲梳电机转速" width="80%"></base-input>
                                    </FormItem>
                                </Form>
                                </Col>
                                <Col :xs="24" :md="12" :sm="24">
                                <header class="example-header">
                                        <span style="margin-left: 20px">
                                            品质要求
                                        </span>
                                </header>
                                <Form ref="fmformpz" :model="fmform" :label-width="120">
                                    <FormItem label="毛高：" prop="fm_mg">
                                        <base-input v-model="fmform.fm_mg" placeholder="请输入毛高" width="80%"></base-input>
                                    </FormItem>
                                    <FormItem label="二毛：" prop="fm_em">
                                        <base-input v-model="fmform.fm_em" placeholder="请输入二毛" width="80%"></base-input>
                                    </FormItem>
                                </Form>
                                <header class="example-header">
                                        <span style="margin-left: 20px">
                                            图片上传
                                        </span>
                                </header>
                                <div style="text-align: left;padding: 20px">
                                    <uploadImg ref="fm" myref="fmupload" :action="fmaction"></uploadImg>
                                </div>
                                </Col>
                                <div class="example-split" style="left: 50%"></div>
                            </Row>
                        </div>
                        <div v-if="bzform.items[gycurrent].value == 'ft'">
                            <Row>
                                <Col :xs="24" :md="12" :sm="24">
                                <header class="example-header">
                                        <span style="margin-left: 20px">
                                            工艺参数
                                        </span>
                                </header>
                                <Form ref="ftform" :model="ftform" :label-width="120">
                                    <FormItem label="机台：" prop="ft_jt">
                                        <base-input v-model="ftform.ft_jt" placeholder="请输入机台编号" width="80%"></base-input>
                                    </FormItem>
                                    <FormItem label="刀架：" prop="ft_dj">
                                        <base-input v-model="ftform.ft_dj" placeholder="请输入刀架" width="80%"></base-input>
                                    </FormItem>
                                    <FormItem label="牵引滚筒：" prop="ft_qygt">
                                        <base-input v-model="ftform.ft_qygt" placeholder="请输入牵引滚筒" width="80%"></base-input>
                                    </FormItem>
                                    <FormItem label="车速：" prop="ft_cs">
                                        <base-input v-model="ftform.ft_cs" placeholder="请输入车速" width="80%"></base-input>
                                    </FormItem>
                                    <FormItem label="尺寸：" prop="ft_cc">
                                        <base-input v-model="ftform.ft_cc" placeholder="请输入尺寸" width="80%"></base-input>
                                    </FormItem>
                                    <FormItem label="毛高：" prop="ft_mg">
                                        <base-input v-model="ftform.ft_mg" placeholder="请输入毛高" width="80%"></base-input>
                                    </FormItem>
                                </Form>
                                </Col>
                                <Col :xs="24" :md="12" :sm="24">
                                <header class="example-header">
                                        <span style="margin-left: 20px">
                                            品质要求
                                        </span>
                                </header>
                                <Form ref="ftformpz" :model="ftform" :label-width="120">
                                    <FormItem label="尺寸：" prop="ftpzcc">
                                        <base-input v-model="ftform.ft_pzcc" placeholder="请输入尺寸" width="80%"></base-input>
                                    </FormItem>
                                    <FormItem label="毛高：" prop="ft_pzmg">
                                        <base-input v-model="ftform.ft_pzmg" placeholder="请输入毛高" width="80%"></base-input>
                                    </FormItem>
                                    <FormItem label="偏条：" prop="ft_pzpt">
                                        <base-input v-model="ftform.ft_pzpt" placeholder="请输入偏条" width="80%"></base-input>
                                    </FormItem>
                                    <FormItem label="底板：" prop="ft_pzdb">
                                        <base-input v-model="ftform.ft_pzdb" placeholder="请输入底板" width="80%"></base-input>
                                    </FormItem>
                                    <FormItem label="绒毛：" prop="ft_pzrm">
                                        <base-input v-model="ftform.ft_pzrm" placeholder="请输入绒毛" width="80%"></base-input>
                                    </FormItem>
                                </Form>
                                <header class="example-header">
                                        <span style="margin-left: 20px">
                                            图片上传
                                        </span>
                                </header>
                                <div style="text-align: left;padding: 20px">
                                    <uploadImg ref="ft" myref="ftupload" :action="ftaction"></uploadImg>
                                </div>
                                </Col>
                                <div class="example-split" style="left: 50%"></div>
                            </Row>
                        </div>
                        <div v-if="bzform.items[gycurrent].value == 'fq'">
                            <Row>
                                <Col :xs="24" :md="12" :sm="24">
                                <header class="example-header">
                                        <span style="margin-left: 20px">
                                            工艺参数
                                        </span>
                                </header>
                                <Form ref="fqform" :model="fqform" :label-width="120">
                                    <FormItem label="机台：" prop="fq_jt">
                                        <base-input v-model="fqform.fq_jt" placeholder="请输入机台编号" width="80%"></base-input>
                                    </FormItem>
                                    <FormItem label="车速：" prop="fq_cs">
                                        <base-input v-model="fqform.fq_cs" placeholder="请输入车速" width="80%"></base-input>
                                    </FormItem>
                                    <FormItem label="长度设置：" prop="fq_cdsz">
                                        <base-input v-model="fqform.fq_cdsz" placeholder="请输入长度" width="80%"></base-input>
                                    </FormItem>
                                    <FormItem label="分切条数：" prop="fq_fqts">
                                        <base-input v-model="fqform.fq_fqts" placeholder="请输入分切条数" width="80%"></base-input>
                                    </FormItem>
                                </Form>
                                </Col>
                                <Col :xs="24" :md="12" :sm="24">
                                <header class="example-header">
                                        <span style="margin-left: 20px">
                                            品质要求
                                        </span>
                                </header>
                                <Form ref="fqform" :model="fqform" :label-width="120">
                                    <FormItem label="长度：" prop="fq_pzcd">
                                        <base-input v-model="fqform.fq_pzcd" placeholder="请输入长度" width="80%"></base-input>
                                    </FormItem>
                                    <FormItem label="断头绒毛：" prop="fq_pzdtrm">
                                        <base-input v-model="fqform.fq_pzdtrm" placeholder="请输入断头绒毛" width="80%"></base-input>
                                    </FormItem>
                                    <FormItem label="烂毛：" prop="fq_pzlm">
                                        <base-input v-model="fqform.fq_pzlm" placeholder="请输入烂毛" width="80%"></base-input>
                                    </FormItem>
                                </Form>
                                <header class="example-header">
                                        <span style="margin-left: 20px">
                                            图片上传
                                        </span>
                                </header>
                                <div style="text-align: left;padding: 20px">
                                    <uploadImg ref="fq" myref="fqupload" :action="fqaction"></uploadImg>
                                </div>
                                </Col>
                                <div class="example-split" style="left: 50%"></div>
                            </Row>
                        </div>
                        <div v-if="bzform.items[gycurrent].value == 'mq'">
                            <Row>
                                <Col :xs="24" :md="12" :sm="24">
                                <header class="example-header">
                                        <span style="margin-left: 20px">
                                            工艺参数
                                        </span>
                                </header>
                                <Form ref="mqform" :model="mqform" :label-width="120">
                                    <FormItem label="速度：" prop="mq_sd">
                                        <base-input v-model="mqform.mq_sd" placeholder="请输入速度" width="80%"></base-input>
                                    </FormItem>
                                </Form>
                                </Col>
                                <Col :xs="24" :md="12" :sm="24">
                                <header class="example-header">
                                        <span style="margin-left: 20px">
                                            品质要求
                                        </span>
                                </header>
                                <Form ref="mqformpz" :model="mqform" :label-width="120">
                                    <FormItem label="胶带：" prop="mq_jd">
                                        <base-input v-model="mqform.mq_jd" placeholder="请输入胶带要求" width="80%"></base-input>
                                    </FormItem>
                                    <FormItem label="带子：" prop="mq_dz">
                                        <base-input v-model="mqform.mq_dz" placeholder="请输入带子要求" width="80%"></base-input>
                                    </FormItem>
                                </Form>
                                <header class="example-header">
                                        <span style="margin-left: 20px">
                                            图片上传
                                        </span>
                                </header>
                                <div style="text-align: left;padding: 20px">
                                    <uploadImg ref="mq" myref="mqupload" :action="mqaction"></uploadImg>
                                </div>
                                </Col>
                                <div class="example-split" style="left: 50%"></div>
                            </Row>
                        </div>
                        <div v-if="bzform.items[gycurrent].value == 'dx'">
                            <Row>
                                <Col :xs="24" :md="12" :sm="24">
                                <header class="example-header">
                                        <span style="margin-left: 20px">
                                            工艺参数
                                        </span>
                                </header>
                                <Form ref="dxform" :model="dxform" :label-width="120">
                                    <FormItem label="条数：" prop="dx_ts">
                                        <base-input v-model="dxform.dx_ts" placeholder="请输入条数" width="80%"></base-input>
                                    </FormItem>
                                </Form>
                                <div style="padding: 0px 20px">
                                    <header class="example-header">
                                        <span style="margin-left: 20px;font-size: 12px">
                                            加热板A
                                        </span>
                                    </header>
                                    <Form ref="dxformjrb" :model="dxform" :label-width="120">
                                        <FormItem label="启动：" prop="dx_jrbaqd">
                                            <base-input v-model="dxform.dx_jrbaqd" placeholder="请输入加热板A启动" width="80%"></base-input>
                                        </FormItem>
                                        <FormItem label="停止：" prop="dx_jrbatz">
                                            <base-input v-model="dxform.dx_jrbatz" placeholder="请输入加热板A停止" width="80%"></base-input>
                                        </FormItem>
                                    </Form>
                                    <header class="example-header">
                                        <span style="margin-left: 20px;font-size: 12px">
                                            定型板A
                                        </span>
                                    </header>
                                    <Form ref="dxformdxb" :model="dxform" :label-width="120">
                                        <FormItem label="启动：" prop="dx_dxbaqd">
                                            <base-input v-model="dxform.dx_dxbaqd" placeholder="请输入定型板A启动" width="80%"></base-input>
                                        </FormItem>
                                        <FormItem label="停止：" prop="dx_dxbatz">
                                            <base-input v-model="dxform.dx_dxbatz" placeholder="请输入定型板A停止" width="80%"></base-input>
                                        </FormItem>
                                    </Form>
                                    <header class="example-header">
                                        <span style="margin-left: 20px;font-size: 12px">
                                            牵引电机A
                                        </span>
                                    </header>
                                    <Form ref="dxformqydj" :model="dxform" :label-width="120">
                                        <FormItem label="速度：" prop="dx_qydjasd">
                                            <base-input v-model="dxform.dx_qydjasd" placeholder="请输入牵引电机A速度" width="80%"></base-input>
                                        </FormItem>
                                        <FormItem label="长度：" prop="dx_qydjacd">
                                            <base-input v-model="dxform.dx_qydjacd" placeholder="请输入牵引电机A长度" width="80%"></base-input>
                                        </FormItem>
                                        <FormItem label="加速度：" prop="dx_qydjajsd">
                                            <base-input v-model="dxform.dx_qydjajsd" placeholder="请输入牵引电机A加速度" width="80%"></base-input>
                                        </FormItem>
                                    </Form>
                                    <header class="example-header">
                                        <span style="margin-left: 20px;font-size: 12px">
                                            加热板B
                                        </span>
                                    </header>
                                    <Form ref="dxformjrb" :model="dxform" :label-width="120">
                                        <FormItem label="启动：" prop="dx_jrbbqd">
                                            <base-input v-model="dxform.dx_jrbbqd" placeholder="请输入加热板B启动" width="80%"></base-input>
                                        </FormItem>
                                        <FormItem label="停止：" prop="dx_jrbbtz">
                                            <base-input v-model="dxform.dx_jrbbtz" placeholder="请输入加热板B停止" width="80%"></base-input>
                                        </FormItem>
                                    </Form>
                                    <header class="example-header">
                                        <span style="margin-left: 20px;font-size: 12px">
                                            定型板B
                                        </span>
                                    </header>
                                    <Form ref="dxformdxb" :model="dxform" :label-width="120">
                                        <FormItem label="启动：" prop="dx_dxbbqd">
                                            <base-input v-model="dxform.dx_dxbbqd" placeholder="请输入定型板B启动" width="80%"></base-input>
                                        </FormItem>
                                        <FormItem label="停止：" prop="dx_dxbbtz">
                                            <base-input v-model="dxform.dx_dxbbtz" placeholder="请输入定型板B停止" width="80%"></base-input>
                                        </FormItem>
                                    </Form>
                                    <header class="example-header">
                                        <span style="margin-left: 20px;font-size: 12px">
                                            牵引电机B
                                        </span>
                                    </header>
                                    <Form ref="dxformqydj" :model="dxform" :label-width="120">
                                        <FormItem label="速度：" prop="dx_qydjbsd">
                                            <base-input v-model="dxform.dx_qydjbsd" placeholder="请输入牵引电机B速度" width="80%"></base-input>
                                        </FormItem>
                                        <FormItem label="长度：" prop="dx_qydjbcd">
                                            <base-input v-model="dxform.dx_qydjbcd" placeholder="请输入牵引电机B长度" width="80%"></base-input>
                                        </FormItem>
                                        <FormItem label="加速度：" prop="dx_qydjbjsd">
                                            <base-input v-model="dxform.dx_qydjbjsd" placeholder="请输入牵引电机B加速度" width="80%"></base-input>
                                        </FormItem>
                                    </Form>
                                </div>
                                </Col>
                                <Col :xs="24" :md="12" :sm="24">
                                <header class="example-header">
                                        <span style="margin-left: 20px">
                                            图片上传
                                        </span>
                                </header>
                                <div style="text-align: left;padding: 20px">
                                    <uploadImg ref="dx" myref="dxupload" :action="dxaction"></uploadImg>
                                </div>
                                </Col>
                                <div class="example-split" style="left: 50%"></div>
                            </Row>
                        </div>
                        <div v-if="bzform.items[gycurrent].value == 'bz'">
                            <header class="example-header">
                                        <span style="margin-left: 20px">
                                            图片上传
                                        </span>
                            </header>
                            <div style="display: flex">
                                <uploadImg myref="bz1" :action="bzaction1"></uploadImg>
                                <uploadImg myref="bz2" :action="bzaction2"></uploadImg>
                                <uploadImg myref="bz3" :action="bzaction3"></uploadImg>
                                <uploadImg myref="bz4" :action="bzaction4"></uploadImg>
                            </div>
                        </div>
                        <Button type="primary" v-show="gycurrent > 0" @click="gynext(-1)" size="small">上一步</Button>
                        <Button type="primary" v-show="gycurrent < bzform.items.length - 1" @click="gynext(1)" size="small">下一步</Button>'
                        <!--<Button type="primary" @click="gynext(1)" size="small"></Button>-->
                    </Card>
                </div>
                <!--<div v-if="current == 3" style="padding: 30px 10px">
                    添加BOM信息
                </div>-->
                <Button type="primary" v-show="current > 0" @click="next(-1)">上一步</Button>
                <Button type="primary" v-show="current < 2" @click="next(1)">下一步</Button>
                <Button type="primary" v-show="addover" @click="next(1)">完成</Button>
            </template>
        </my-card>
    </div>
</template>
<script>
    import CardTable from '../components/cardTable.vue'
    import MyCard from '../components/myCard.vue'
    import uploadImg from '../components/uploadImg'
    import util from '../../libs/util'

    export default {
        name: 'addproduct',
        data () {
            return {
                header: {'X-Requested-With': 'XMLHttpRequest'},
                qdaction: util.ajaxUrl + 'qiandao/uploadFile' + '?token=' + sessionStorage.getItem('token'),
                tjaction: util.ajaxUrl + 'tujiao/uploadFile' + '?token=' + sessionStorage.getItem('token'),
                tsaction: util.ajaxUrl + 'tiesu/uploadFile' + '?token=' + sessionStorage.getItem('token'),
                jjaction: util.ajaxUrl + 'jiajiao/uploadFile' + '?token=' + sessionStorage.getItem('token'),
                bjaction: util.ajaxUrl + 'beijiao/uploadFile' + '?token=' + sessionStorage.getItem('token'),
                fmaction: util.ajaxUrl + 'feimao/uploadFile' + '?token=' + sessionStorage.getItem('token'),
                ftaction: util.ajaxUrl + 'fentiao/uploadFile' + '?token=' + sessionStorage.getItem('token'),
                fqaction: util.ajaxUrl + 'fenqie/uploadFile' + '?token=' + sessionStorage.getItem('token'),
                mqaction: util.ajaxUrl + 'moqie/uploadFile' + '?token=' + sessionStorage.getItem('token'),
                dxaction: util.ajaxUrl + 'dingxing/uploadFile' + '?token=' + sessionStorage.getItem('token'),
                bzaction1: util.ajaxUrl + 'baozhuang/uploadFile1' + '?token=' + sessionStorage.getItem('token'),
                bzaction2: util.ajaxUrl + 'baozhuang/uploadFile2' + '?token=' + sessionStorage.getItem('token'),
                bzaction3: util.ajaxUrl + 'baozhuang/uploadFile3' + '?token=' + sessionStorage.getItem('token'),
                bzaction4: util.ajaxUrl + 'baozhuang/uploadFile4' + '?token=' + sessionStorage.getItem('token'),
                current: 0,
                gycurrent: 0,
                ref: 'basicproduct',
                basicform: {
                    nub: '',
                    cnub: '',
                    name: '',
                    norm: '',
                    unit: '',
                    color: '',
                    type: '',
                    machine: '',
                    version: ''
                },
                index: 1,
                bzform: {
                    items: [
                        {
                            value: 'zz'
                        },
                        {
                            value: 'tj'
                        },
                        {
                            value: 'fm'
                        },
                        {
                            value: 'ft'
                        },
                        {
                            value: 'fq'
                        },
                        {
                            value: 'bz'
                        }
                    ]
                },
                gylist: [
                    {
                        value: 'zz',
                        label: '织造工序',
                        disabled: false
                    },
                    {
                        value: 'tj',
                        label: '涂胶工序',
                        disabled: false
                    },
                    {
                        value: 'ts',
                        label: '贴塑工序',
                        disabled: false
                    },
                    {
                        value: 'jj',
                        label: '加胶工序',
                        disabled: false
                    },
                    {
                        value: 'bj',
                        label: '背胶工序',
                        disabled: false
                    },
                    {
                        value: 'fm',
                        label: '飞毛工序',
                        disabled: false
                    },
                    {
                        value: 'ft',
                        label: '分条工序',
                        disabled: false
                    },
                    {
                        value: 'fq',
                        label: '分切工序',
                        disabled: false
                    },
                    {
                        value: 'mq',
                        label: '模切工序',
                        disabled: false
                    },
                    {
                        value: 'dx',
                        label: '定型工序',
                        disabled: false
                    },
                    {
                        value: 'bz',
                        label: '包装工序',
                        disabled: false
                    }
                ],
                qdform: {
                    qd_ptgs: '',
                    qd_scts: '',
                    qd_plfs: '',
                    qd_qs: '',
                    qd_wm: '',
                    qd_zdsd: '',
                    qd_sxgg: '',
                    qd_wxgg: '',
                    qd_cc: '',
                    qd_mg: '',
                    qd_dbgm: '',
                    qd_mpzd: '',
                    qd_cd: ''
                },
                tjform: {
                    'tj_jrb1': '',
                    'tj_jrb2': '',
                    'tj_jrb3': '',
                    'tj_jrb4': '',
                    'tj_yhx1': '',
                    'tj_yhx2': '',
                    'tj_wddhx': '',
                    'tj_jd': '',
                    'tj_dhx': '',
                    'tj_cd': '',
                    'tj_jggd': '',
                    'tj_hgd': '',
                    'tj_jd2': '',
                    'tj_dhx2': '',
                    'tj_cd2': '',
                    'tj_jggd2': '',
                    'tj_hgd2': '',
                    'tj_chic': '',
                    'tj_jkqk': '',
                    'tj_tqk': '',
                    'tj_rm': ''
                },
                tsform: {  //  贴塑
                    'ts_mtqqwd': '',
                    'ts_mthqwd': '',
                    'ts_tdwd': '',
                    'ts_flqwd': '',
                    'ts_jtjrwd': '',
                    'ts_ldwd': '',
                    'ts_jdqysd': '',
                    'ts_cdqysd': '',
                    'ts_slqysd': '',
                    'ts_lgjjsd': '',
                    'ts_zjzs': '',
                    'ts_zjdl': '',
                    'ts_jtyqwd': '',
                    'ts_jteqwd': '',
                    'ts_jtsqwd': '',
                    'ts_jtfqwd': '',
                    'ts_jtwqwd': '',
                    'ts_rw': ''
                },
                jjform: {  //  加胶
                    'jj_qysd': '',
                    'jj_qyqy': '',
                    'jj_ylqy': '',
                    'jj_dws': '',
                    'jj_fb': ''
                },
                bjform: { // 背胶
                    'bj_jt': '',
                    'bj_qy': '',
                    'bj_cxsj': '',
                    'bj_jgsj': '',
                    'bj_fldx': '',
                    'bj_qysd': '',
                    'bj_cldjzs': '',
                    'bj_tmdsd': '',
                    'bj_wz': '',
                    'bj_bll': ''
                },
                fmform: {  // 飞毛
                    'fm_jt': '',
                    'fm_gdpl': '',
                    'fm_qypl': '',
                    'fm_ts': '',
                    'fm_bz': '',
                    'fm_csdjzs': '',
                    'fm_mg': '',
                    'fm_em': ''
                },
                ftform: {  //  分条
                    'ft_jt': '',
                    'ft_dj': '',
                    'ft_qygt': '',
                    'ft_cs': '',
                    'ft_cc': '',
                    'ft_mg': '',
                    'ft_pzcc': '',
                    'ft_pzmg': '',
                    'ft_pzpt': '',
                    'ft_pzdb': '',
                    'ft_pzrm': '',
                },
                fqform: {  //  分切
                    'fq_jt': '',
                    'fq_cs': '',
                    'fq_cdsz': '',
                    'fq_fqts': '',
                    'fq_pzcd': '',
                    'fq_pzdtrm': '',
                    'fq_pzlm': ''
                },
                mqform: {  // 模切
                    'mq_sd': '',
                    'mq_jd': '',
                    'mq_dz': ''
                },
                dxform: { // 定型
                    'dx_ts': '',
                    'dx_jrbaqd': '',
                    'dx_jrbatz': '',
                    'dx_dxbaqd': '',
                    'dx_dxbatz': '',
                    'dx_qydjasd': '',
                    'dx_qydjacd': '',
                    'dx_qydjajsd': '',
                    'dx_jrbbqd': '',
                    'dx_jrbbtz': '',
                    'dx_dxbbqd': '',
                    'dx_dxbbtz': '',
                    'dx_qydjbsd': '',
                    'dx_qydjbcd': '',
                    'dx_qydjbjsd': ''
                },
                bzimg: {
                    bz1: '',
                    bz2: '',
                    bz3: '',
                    bz4: ''
                },
                addover: false
            }
        },
        watch: {
            '$store.state.role': {
                handler: function (val, oldVal) {
                    let role = this._.find(val, function(chr) {
                        return chr == '31'
                    }) ? true : false
                    if (!role) {
                        this.$store.commit('setCurrentTagName', 'sy')
                    }
                },
                deep: true
            }
        },
        filters: {
            gycontent: function (value) {
                switch (value) {
                    case 'qd':
                        return '织造工序';
                    case 'tj':
                        return '涂胶工序';
                    case 'ts':
                        return '贴塑工序';
                    case 'jj':
                        return '加胶工序';
                    case 'bj':
                        return '背胶工序';
                    case 'fm':
                        return '飞毛工序';
                    case 'ft':
                        return '分条工序';
                    case 'fq':
                        return '分切工序';
                    case 'mq':
                        return '模切工序';
                    case 'dx':
                        return '定型工序';
                    case 'bz':
                        return '包装工序';
                }
            }
        },
        computed: {
        },
        methods: {
            onSuccess (response) {
                console.log(response, '上传成功')
                let msg = ''
                switch (response.data.status) {
                    case 100:
                        break;
                    case 101:
                        msg = '用户名密码错误'
                        break;
                    case 102:
                        msg = '无效token'
                        break;
                    case 103:
                        msg = '用户名已存在'
                        break;
                    case 105:
                        msg = '采购员已存在'
                        break;
                    case 111:
                        msg = '未知错误'
                        break;
                }
            },
            onError () {
                console.log('上传失败')
            },
            getcurrenttitle (index) {
                if (this.current < index) {
                    return '待进行'
                } else if (this.current == index) {
                    return '进行中'
                } else {
                    return '已完成'
                }
            },
            getgycurrenttitle (index) {
                if (this.gycurrent < index) {
                    return '待进行'
                } else if (this.gycurrent == index) {
                    return '进行中'
                } else {
                    return '已完成'
                }
            },
            handleAdd (index) {
                if (index > 12) {
                    return
                }
                this.bzform.items.splice(index + 1, 0, {
                    value: ''
                })
            },
            handleRemove (index) {
                if (index < 1) {
                    return
                }
                this.bzform.items.splice(index, 1)
            },
            gynext (index) {
                if (index > 0) {
                    let ref = this.bzform.items[this.gycurrent].value
                    console.log(this.$refs[ref])
                    this.$refs[ref].cleandefaultList()
                    switch (this.bzform.items[this.gycurrent].value) {
                        case 'zz':
                            this.http.addQiandao(this, this.qdform, 'qiandao/addQiandao')
                            break
                        case 'tj':
                            this.http.addQiandao(this, this.tjform, 'tujiao/addTujiao')
                            break
                        case 'ts':
                            this.http.addQiandao(this, this.tsform, 'tiesu/addTiesu')
                            break
                        case 'jj':
                            this.http.addQiandao(this, this.jjform, 'jiajiao/addJiajiao')
                            break
                        case 'bj':
                            this.http.addQiandao(this, this.bjform, 'beijiao/addBeijiao')
                            break
                        case 'fm':
                            this.http.addQiandao(this, this.fmform, 'feimao/addFeimao')
                            break
                        case 'ft':
                            this.http.addQiandao(this, this.ftform, 'fentiao/addFentiao')
                            break
                        case 'fq':
                            this.http.addQiandao(this, this.fqform, 'fenqie/addFenqie')
                            break
                        case 'mq':
                            this.http.addQiandao(this, this.mqform, 'moqie/addMoqie')
                            break
                        case 'dx':
                            this.http.addQiandao(this, this.dxform, 'dingxing/addDingxing')
                            break
                        case 'bz':
                            //this.http.addQiandao(this, this.qdform, 'qiandao/addQiandao')
                            break
                    }
                    /*let index2 = this._.findIndex(this.bzform.items, (item) => {
                        return item.value == this.bzform.items[this.gycurrent].value
                    })*/
                } else {
                    this.gycurrent += index
                }
            },
            next (index) {
                if (index == '99') {
                    let tagdata = this.$store.state.tagdata
                    console.log(tagdata)
                    let index = this._.findIndex(tagdata, (chr) => {
                        return chr.id == 'addproduct';
                    });
                    tagdata.splice(index, 1)
                    this.$store.commit('setTagdata', tagdata)
                    if (tagdata.length == 0) {
                        this.$store.commit('setCurrentTagName', this.sytagdata.id)
                        return
                    }
                    this.$store.commit('setCurrentTagName', this._.last(tagdata).id)
                    return
                }
                if (index > 0) {
                    if (this.current == 0) {
                        console.log('请求基础数据')
                        this.http.addProduct(this, this.basicform)
                    } else if (this.current == 1) {
                        let gy = this.bzform.items
                        console.log(gy)
                        let gydata = ''
                        for (let i in gy) {
                            gydata += gy[i].value + ','
                        }
                        console.log(gydata)
                        this.http.addGY(this, {gy: gydata})
                    } else if (this.current == 2) {
                        console.log('执行添加工艺完成')
                        if (this.gycurrent < this.bzform.items.length - 1) {
                            this.$Modal.error({
                                title: '提示',
                                content: '请完成工艺添加'
                            });
                            return
                        }
                        this.http.addProductSure(this, {})
                    } else if (this.current == 3) {

                    }
                } else {
                    this.current += index
                }
            }
        },
        components: {
            CardTable,
            MyCard,
            uploadImg
        },
        mounted: function () {
            let role = this._.find(this.$store.state.role, function(chr) {
                return chr == '31'
            }) ? true : false
            if (!role) {
                this.$store.commit('setCurrentTagName', 'sy')
            }
        }
    };
</script>
